package com.itheima.tliassystem.exception;



import entity.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//全局异常处理
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public Result handelException(Exception e) {
        e.printStackTrace();
        return Result.error("系统异常 请联系管理员");
}
//账号密码异常处理
@ExceptionHandler(BaseException.class)
    public Result handelException(BaseException e) {
        e.printStackTrace();
        return  Result.error(e.getMessage());
    }
}
